package com.yc.wxcontroller;

import com.yc.service.ScheduleService;
import com.yc.service.impl.WxScheduleServiceImp;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * @author zxy
 * @version 1.0
 * @description: TODO
 * @date 2023/7/24 11:03
 */
@Api("微信管理课程表控制器")
//@RestController
//@RequestMapping("/wx/schedule")
public class WXScheduleController {

    @Resource
    private WxScheduleServiceImp wxScheduleServiceImp;

    /**
     * 查询学年
     * @return
     */
    @PostMapping("/selectschoolyear")
    public List<Map<String,Object>> selectschoolyear(){
        return wxScheduleServiceImp.selectschoolyear();
    }

    @PostMapping("/selectwhichweekandyear")
    public Map<String, Object> selectwhichweekandyear(String day){
        return wxScheduleServiceImp.selectwhichweekandyear(day);
    }

    @PostMapping("/selectdayyearweek")
    public Map<String,Object> selectdayyearweek(String day){
        return wxScheduleServiceImp.selectdayyearweek(day);
    }

    @PostMapping("/selectstuclassbyweek")
    public List<Map<String,Object>> selectstuclassbyweek(String stuid,String week) throws ParseException {
        return wxScheduleServiceImp.selectstuclass(stuid,week);
    }
    @PostMapping("/selectteacherclass")
    public List<Map<String,Object>> selectteacherclass(String tid,String week) throws ParseException {
        return wxScheduleServiceImp.selectteacherclass(tid,week);
    }
    @PostMapping("/selectdaybyweek")
    public List<String> selectdaybyweek(String week, String year){
        return wxScheduleServiceImp.selectdaybyweek(week, year);
    }
}
